<?php
	include '../../db.php';
	if((isset($_GET['action']))&&(isset($_GET['sid']))){
		$salesId = $_GET['sid'];
		if($_GET['action'] == 'remove'){
			$sql = sprintf("UPDATE sales SET isActive=0 WHERE salesID='%s'", mysql_real_escape_string($salesId));
			$url_target = 'Location:../../led-master.php?mngr=sale&subpg=delete&action=saledelsuccess';	
		}else if($_GET['action'] == 'restore'){
			$sql = sprintf("UPDATE sales SET isActive=1 WHERE salesID='%s'", mysql_real_escape_string($salesId));
			$url_target = 'Location:../../led-master.php?mngr=sale&subpg=delete&action=saleressuccess';
		}
		@mysql_query($sql);		 
		header($url_target);
	}
?>